package org.jwos.platform.domain;

public class PluginResource {
	
	public static final int TYPE_SCRIPT = 1;
	
	public static final int TYPE_STYLE = 2;
	
	private int type = TYPE_SCRIPT;
	
	private String path;
	
	private String version;
	
	public PluginResource() {		
	}
	
	public PluginResource(String path) {
		this.path = path;
	}
	
	public PluginResource(String path,String version) {
		this(path);
		this.version = version;
	} 
	
	public PluginResource(int type,String path) {
		this(path);
		this.type = type;
	}
	
	public PluginResource(int type,String path,String version) {
		this(type,path);
		this.version = version;
	}
	
	public String getPathWithVersion() {
		return this.path + (this.version!=null ? "?v="+this.version : "");
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

}
